package com.ryskoo.customer.customeraddress.repository;


import com.ryskoo.common.constant.CacheConstant;
import com.ryskoo.customer.customeraddress.domain.CustomerAddressPO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

/**
 * @author thq
 */
@Primary
@Repository
public class CustomerAddressRedisImpl extends BasicRedisImpl<CustomerAddressPO> implements ICustomerAddressRepository {

	@Autowired
	private RedisUtil redisClient;

	@Autowired
	private ICustomerAddressRepository customerAddressRepository;

	@PostConstruct
	public void init() {
		this.setRedisClient(redisClient);
		this.setDao(customerAddressRepository);
	}

	public CustomerAddressRedisImpl() {
		super(CacheConstant.CUSTOMER_CUSTOMER_ADDRESS_KEY);
	}

}
